<template>
	<view class="center_content">
		<view class="center_name">空间名称</view>
		<view class="center_info">
			<view class="center_info_p">{{centerData.agentName}}</view>
			<view class="center_info_p">{{centerData.mainAgentName}}</view>
			<view class="center_info_p">{{centerData.createTime}}</view>
		</view>
		<view class="center_name">统计信息</view>
		<view class="count">
			<view class="count_inner">
				<view class="count_title">累计</view>
				<view class="count_number">{{centerData.totalAllowance}}</view>
			</view>
			<view class="count_inner">
				<view class="count_title">今日</view>
				<view class="count_number">{{centerData.todayPerformance}}</view>
			</view>
			<view class="count_inner">
				<view class="count_title">当日</view>
				<view class="count_number">67867{{centerData.todayAllowance}}</view>
			</view>
			<view class="count_inner">
				<view class="count_title">粉丝</view>
				<view class="count_number">{{centerData.fans}}人</view>
			</view>
		</view>
		<view class="center_name">抢购人数分布</view>
		<view class="count">
			<view class="count_inner">
				<view class="count_title">抢1</view>
				<view class="count_number">{{centerData.buy1}}人</view>
			</view>
			<view class="count_inner">
				<view class="count_title">抢2</view>
				<view class="count_number">{{centerData.buy2}}人</view>
			</view>
			<view class="count_inner">
				<view class="count_title">抢3</view>
				<view class="count_number">{{centerData.buy3}}人</view>
			</view>
			<view class="count_inner">
				<view class="count_title">抢4</view>
				<view class="count_number">{{centerData.buy4}}人</view>
			</view>
			<view class="count_inner">
				<view class="count_title">抢5</view>
				<view class="count_number">{{centerData.buy5}}人</view>
			</view>
			<!-- <view class="count_inner">
				<view class="count_title">新增</view>
				<view class="count_number">0人</view>
			</view> -->
		</view>
		<view class="center_name">团队表现</view>
		<view class="center_table">
			<view class="center_tr" style="background: #FFFFFF;" >
				<view class="center_td">姓名</view>
				<view class="center_td">当日</view>
				<view class="center_td">--</view>
			</view>
			<view class="center_tr" v-for="(team,index) in teamList" :key="index">
				<view class="center_td">{{team.nickName}}</view>
				<view class="center_td">{{team.todayPerformance}}</view>
				<view class="center_td">{{team.totalAllowance}}</view>
			</view>
			
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				centerData:{},
				teamList:[],
			}
		},
		onLoad() {
			this.userSpace();
		},
		methods: {
			
			
			userSpace(){
				let that = this
				that.$api.request('/api/web/','/selectUserSpace',{
					
				}, failres => {
					console.log("failres",failres);
					
					uni.showToast({
						title: failres.msg,
						icon: "none"
					});
				}).then(res => {
					console.log("then res",res);
					that.centerData=res.data;
					that.teamList=res.data.teamList;
					//that.form=res.data;
					/* uni.showToast({
						title: res.msg,
						icon: "none"
					}); */
				
				})
				
			}
		}
	}
</script>

<style lang="scss">
	.center_content{
		background: #F6F6F6;
		min-height: 100vh;
		padding-top: 20upx;
		.center_name{
			color: #333333;
			height: 30upx;
			margin-top: 20upx;
			margin-left: 20upx;
			border-left: 6upx solid green;
			padding-left: 20upx;
			line-height: 30upx;
			margin-bottom: 20upx;
		}
		.center_info{
			width: 100%;
			background: #FFFFFF;
			padding: 10upx 0;
			.center_info_p{
				font-size: 28upx;
				color: #333333;
				margin-bottom: 10upx;
				padding-left: 20upx;
			}
		}
		.count{
			width: 100%;
			background: #FFFFFF;
			padding: 10upx;
			display: flex;
			align-items: center;
			flex-wrap: wrap;
			.count_inner{
				width: 25%;
				height: 100upx;
				border-right: 1upx solid #eeeeee;
				text-align: center;
				padding: 10upx 0;
				background: #FFFFFF;
				margin-bottom: 20upx;
				.count_title{
					font-size: 28upx;
					margin-bottom: 10upx;
					color: #333333;
				}
				.count_number{
					color: #BD7E92;
					font-size: 28upx;
				}
			}
			.count_inner:nth-child(4n){
				border-right: none;
			}
		}
		.center_table{
			width: 100%;
			.center_tr{
				width: 100%;
				display: flex;
				align-items: center;
				justify-content: space-between;
				text-align: center;
				.center_td{
					font-size: 28upx;
					color: #333333;
					height: 50upx;
					line-height: 50upx;
					margin-bottom: 10upx;
					margin-top: 10upx;
					text-align: center;
					width: 33%;
				}
			}
		}
			
	}
	
</style>
